import request from '@/config/axios'

// 社交客户端 VO
export interface SocialClientVO {
  id: number // 编号
  name: string // 应用名
  socialType: number // 社交平台
  userType: string // 用户类型
  clientId: string // 客户端编号
  clientSecret: string // 客户端密钥
  agentId?: string // agentId
  status: number // 状态
}

// 社交客户端 API
export const SocialClientApi = {
  // 获取社交客户端分页
  getSocialClientPage: async (params: PageParam) => {
    return await request.get({ url: `/system/social-client/page`, params })
  },

  // 获取社交客户端精简信息列表
  getSocialClientSimpleList: async () => {
    return await request.get({ url: `/system/social-client/simple-list` })
  },

  // 获取社交客户端详情
  getSocialClient: async (id: number) => {
    return await request.get({ url: `/system/social-client/get`, params: { id } })
  },

  // 新增社交客户端
  createSocialClient: async (data: SocialClientVO) => {
    return await request.post({ url: `/system/social-client/create`, data })
  },

  // 修改社交客户端
  updateSocialClient: async (data: SocialClientVO) => {
    return await request.post({ url: `/system/social-client/update`, data })
  },

  // 删除社交客户端
  deleteSocialClient: async (id: number) => {
    return await request.delete({ url: `/system/social-client/delete`, params: { id } })
  }
}
